{include file="public/header" /}
<style type="text/css">
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0;
        margin-top: 0;
    }

    #title span {
        float: right;
    }

    .btn-active {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar">
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq ''} btn-active{/if}" href="{:url('member/index')}" >所有用户</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 1} btn-active{/if}" href="{:url('member/index', ['type' => 1])}">VIP</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 5} btn-active{/if}" href="{:url('member/index', ['type' => 5])}">女神</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 2} btn-active{/if}" href="{:url('member/index', ['type' => 2])}">今日注册</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 3} btn-active{/if}" href="{:url('member/index', ['type' => 3])}">男性用户</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 6} btn-active{/if}" href="{:url('member/index', ['type' => 6])}">男性认证用户</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 4} btn-active{/if}" href="{:url('member/index', ['type' => 4])}">女性用户</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 7} btn-active{/if}" href="{:url('member/index', ['type' => 7])}">女性认证用户</a>
                        <a class="btn btn-default btn-outline{if input('get.type/d') eq 8} btn-active{/if}" href="{:url('member/index', ['type' => 8])}">合伙人</a>
                    </div>
                    <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form method="get" action="">
                            <div class="pull-left search">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="type">
                                        <option {if input('param.type') eq 'usernmae'}selected="selected"{/if} value="username">手机</option>
                                        <option {if input('param.type') eq 'nickname'}selected="selected"{/if} value="nickname">昵称</option>
                                        <option {if input('param.type') eq 'id'}selected="selected"{/if} value="id">用户ID</option>
                                    </select>
                                </div>
                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px"
                                            class="btn btn-default btn-outline" type="submit">搜索
                                    </button>
                                </div>
                                <div class="pull-right search">
                                    <input class="form-control input-outline" type="text" name="text" value="{:input('get.text', '')}" />
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                    <tr>
                                        <th data-align="center">ID</th>
                                        <th data-align="center">头像</th>
                                        <th data-align="center">昵称</th>
                                        <th data-align="center">性别</th>
                                        <th data-align="center">城市</th>
                                        <th data-align="center">手机</th>
                                        <th data-align="center">可用余额(金币)</th>
                                        <th data-align="center">邀请人</th>
                                        <th data-align="center">邀请码</th>
                                        <th data-align="center">注册时间</th>
                                        <th data-align="center">账号类型</th>
                                        <th data-align="center">状态</th>
                                        <th data-align="center">最后登录</th>
                                        <th data-align="center">管理</th>
                                    </tr>
                                </thead>
                                <tbody id="form">
                                    {volist name="data" id="v"}
                                    <tr id="id{$v.id}" class="class">
                                        <td>{$v.id}</td>
                                        <td>
                                            <img src="{if empty($v.avatar)}__PUBLIC__/disk/avatar/user-default.jpg{else}{$v.avatar}{/if}"  width="40" height="40" />
                                        </td>
                                        <td>{$v.nickname}<br/>{$types[$v.type]}<br/>{$identitys[$v.identity]}</td>
                                        <td>
                                            {switch $v.sex}
                                                {case 1}男{/case}
                                                {case 2}女{/case}
                                                {default /}其他
                                            {/switch}
                                        </td>
                                        <td>{$v.city}</td>
                                        <td>{$v.username}</td>
                                        <td>{$v.available_balance}</td>
                                        <td>
                                            {if $v.parent_id>0}
                                            <p>{$v.parent_nickname}</p>
                                            {$v.parent_username}
                                            {/if}
                                        </td>
                                        <td>{$v.invite_code}</td>
                                        <td>{$v.create_time|date='Y-m-d H:i:s'}</td>
                                        <td>{if $v.is_company}公司{else}
                                            {$v.level_name}{if $v.video_verify and $v.sex eq 2}（女神）{/if}
                                            {/if}</td>
                                        <td>
                                            <span style="color: #{if $v.status eq 1}1ab394{else}f00{/if};">{if $v.status eq 1}启{else}禁{/if}用</span>
                                        </td>
                                        <td>
                                            {if $v.last_login_time gt 0}
                                                {$v.last_login_time|date="Y-m-d H:i:s"}
                                            {else}
                                                从未登陆
                                            {/if}
                                        </td>
                                        <td>
                                            <div class="btn-group">
                                                <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">
                                                    操作 <span class="caret"></span>
                                                </div>
                                                <ul class="dropdown-menu">
                                                    <li><a onClick="add('{:url('Recharge/recharge',['member_id'=>$v['id'],'url'=>-1])}')">充值</a></li>
                                                    <li><a onClick="add('{:url('addImage',['id'=>$v['id'],'url'=>-1])}')">上传照片</a></li>
                                                    <li><a href="{:url('file/index', ['search_field' =>'m.id', 'search_value' => $v['id'], 'back' => 1])}">查看照片</a>
                                                    <li class="divider"></li>
                                                    <li><a onClick="add('{:url('add',['id'=>$v['id'],'url'=>-1])}')">修改资料</a></li>
                                                    <!--<li><a onClick="del({$v.id})">删除账号</a>-->
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page|raw}</div>
            </div>
        </div>
    </div>
</div>

{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table-zh-CN.min.js"}
<script type="text/javascript">
    function add(url){
        layer.open({
            type: 2,
            title: '会员管理',
            shadeClose: false,
            shade: 0.2,
            area: ['80%', '95%'],
            skin:'shangchuantup',
            // shift:-1,
            content: url,
        });
    }
    function del(id) {
        swal_del(id, "{:url('del')}", {title:'该会员'});
    }
</script>